#include <iostream>
#include "Cabai.h"
#include "Mangga.h"
#include "field.h"
#include "jamur.h"
using namespace std;


int main() {
	extern HANDLE hOut;
	COORD ReportWhere = (0,0);
	

	field afield;
	for(int i=0;i<13;i++) {
		for(int j=0;j<13;j++) {
			if(afield.IsPlowable(j,i)) {
				dynamic_cast<Tanah*>(afield.getObject(j,i))->SetPlowed(true);
				afield.InsertPlant(new Cabai(),j,i);
				dynamic_cast<Plant*>(afield.getObject(j,i))->SetHappyMeter(3);
				dynamic_cast<Plant*>(afield.getObject(j,i))->SetUmur(2);
			}
		}
	}
	afield.Display(0,0,0,0,0,0,0,0,0,0,0,0);
	for(int i=0;i<13;i++) {
		for(int j=0;j<13;j++) {
			if(afield.IsWaterable(j,i)) {
				dynamic_cast<Plant*>(afield.getObject(j,i))->watered();
			}
		}
	}
	afield.Display(0,0,0,0,0,0,0,0,0,0,0,0);
	afield.GrowAllPlant();
	afield.Display(0,0,0,0,0,0,0,0,0,0,0,0);
	return 0;
}
